<?php

/*
 * Author: thanhvd
 * Mail  : thanhvd89@gmail.com
 * Blog  : thanhvd89.wordpress.com
 * 
 */

class TP_Controller {
    
    protected $tp_conn;
            
    function __construct() {
        $this->tp_conn = Config::connect();
        //$this->tp_conn->debug = true;
    }
    
    function __call($name, $arguments) {
        throw new Exception("Method not found!");
    }
    
    function __set($name, $value) {
        $method = "set".ucfirst($name);
        if (method_exists($this, $method)) $this->$method($value);
    }
    
    function __get($name) {
        $method = "get".ucfirst($name);
        if (method_exists($this, $method)) $this->$method();
    }
    
}

?>
